import request from '../../request.js';
import {
	managerHotUrl,
	fundDetails,
	description,
	trendUrl,
	getgold,
	cialUrl,
	fundOrderUrl,
	fundPayUrl,
	fundSaleUrl,
	getGoldurl,
	getGoldPrice
} from "../../urls"

export default {
	fundHot(data, type) {
		console.log(data, type);
		return request({
			url: managerHotUrl + type.selectType,
			method: 'GET',
			data
		});
	},
	fundDetails(data) {
		return request({
			url: fundDetails,
			method: 'GET',
			data
		})
	},
	fundDes(code) {
		return request({
			url: description + code.fundCode,
			method: 'GET',
		})
	},
	fundTrend(data, code) {
		return request({
			url: trendUrl + code.fundCode,
			method: 'GET',
			data
		})
	},
	// 
	// 
	//黄金列表
	getgold(data) {
		console.log(data)
		return request({
			url: getgold,
			method: 'GET',
			data
		})
	},
	// 用户买入基金前置订单
	fundOrder(data) {
		//后端给的是真的溜
		console.log(data, 1111);
		return request({
			url: fundOrderUrl + "?fundCode=" + data.fundCode + "&simplifyName=" + data.simplifyName +
				"&userId=" + data.userId,
			method: 'POST',
		})
	},
	// 用户买入基金基金
	fundPay(data) {
		return request({
			url: fundPayUrl + "?balance=" + data.balance + "&orderId=" + data.orderId + "&payPassWord=" + data
				.payPassWord + "&userId=" + data.userId,
			method: 'POST',
			data
		})
	},
	// 用户卖出基金
	fundSale(data) {
		return request({
			url: fundSaleUrl,
			method: 'POST',
			data
		})
	},		
	//黄金
	goldMessage(data){
		return request({
			url: getGoldurl + "?goldCode=" + data,
			method:"GET"
		})
	},
	goldHostprice(data){
		return request({
			url:getGoldPrice + "?days=6&goldCode=" +data,
			method:"GET"
		})
	}
}
